#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include<math.h>

int main() {
    int a, b, c;
    char d;
    scanf("%d-%d-%d-%c", &a, &b, &c, &d);// 注意 while 处理多个 case
    int sum = 0;
    sum += a;
    int tmp = b;
    int b1 = b;
    int c1 = c;
    int x1 = 3;
    int cs = 100;
    for (int i = 2; i < 5; i++)
    {
        sum += (b / cs) * i;
        b %= cs;
        cs /= 10;
    }
    cs = 10000;
    for (int i = 5; i < 10; i++)
    {
        sum += (c / cs) * i;
        c %= cs;
        cs /= 10;
    }
    sum %= 11;
    if (d - '0' == sum || (d == 'X' && sum == 10))
        printf("Right");
    else
        if (sum == 10)
            printf("%d-%d-%d-X", a, b1, c1);
        else
            printf("%d-%d-%d-%d", a, b1, c1, sum);
    return 0;
}